package com.hgyc.mom.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.hgyc.mom.base.mapper.UnitMapper;
import com.hgyc.mom.base.entity.Unit;
import com.hgyc.mom.base.service.UnitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * 单位信息Service业务层处理
 *
 * @author fwj
 * @since 2025-04-22
 */
@Service
public class UnitServiceImpl extends ServiceImpl<UnitMapper, Unit> implements UnitService
{
    @Override
    public String importData(List<Unit> unitList, boolean updateSupport) {
        return "";
    }

    @Override
    public Unit getByName(String unitName) {
        LambdaQueryWrapper<Unit> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Unit::getUnitName, unitName);
        return this.getOne(wrapper, false);
    }
}
